package com.cn.zmc.design.singleton;


/*
 *  懒汉模式
 * */
public class LazySingleton {

    public static volatile LazySingleton singleton;

    public LazySingleton getSingleton() {
        if (singleton == null) {
            synchronized (LazySingleton.class) {
                if (singleton == null) {
                    singleton = new LazySingleton();
                }
            }
        }
        return singleton;
    }

}
